<?
class HomeController extends Controller {
    private $userService;

    public function HomeController(){
        // Call parent constructor, otherwise controller won't work correctly
        parent::__construct();
    }

    public function index($var){
        $this->renderText('<div class="post"><h1 class="title">Hello World</h1></div>');
    }

    public function listPersons($var){
        // Get all persons from the db and put them in the view context
        $this->set("persons", db::get("Person"));

        $this->renderView("home/listPersons");
    }
}

?>